#include <nice2d/piece/factioncontroller.h>
#include <nice2d/piece/piecescene.h>

class FactionControllerData
{
public:
    FactionControllerType type;
    sf::Color factionColor;
    std::weak_ptr<PieceScene> scene;
    bool requireNewAction = false;
};

FactionController::FactionController():
    data(new FactionControllerData())
{
}

FactionController::~FactionController()
{
}

void FactionController::setControllerType(FactionControllerType type)
{
    data->type = type;
}

FactionControllerType FactionController::getControllerType() const
{
    return data->type;
}

void FactionController::setFactionColor(const sf::Color &color)
{
    data->factionColor = color;
}

sf::Color FactionController::getFactionColor() const
{
    return data->factionColor;
}

void FactionController::setPieceScene(std::shared_ptr<PieceScene> scene)
{
    if(scene)
        data->scene = scene;
}

std::weak_ptr<PieceScene> FactionController::getPieceScene()const
{
    return data->scene;
}

void FactionController::reqireNewAction()
{
    data->requireNewAction = true;
}

bool FactionController::isReqireNewAction() const
{
    return data->requireNewAction;
}

void FactionController::update(float deltaTime)
{

}
